﻿USE [trading]
GO
/****** Object:  Table [dbo].[stock]    Script Date: 04/17/2014 10:15:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[stock](
	[code] [nvarchar](50) NOT NULL,
	[exchange] [nvarchar](50) NOT NULL,
	[companyName] [nvarchar](512) NULL,
	[companyName_1] [nvarchar](512) NULL,
	[yahooId] [nvarchar](50) NULL,
 CONSTRAINT [PK_stock_1] PRIMARY KEY CLUSTERED 
(
	[code] ASC,
	[exchange] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[hist]    Script Date: 04/17/2014 10:15:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[hist](
	[code] [nvarchar](50) NOT NULL,
	[exchange] [nvarchar](50) NOT NULL,
	[date] [date] NOT NULL,
	[open] [float] NOT NULL,
	[close] [float] NOT NULL,
	[low] [float] NOT NULL,
	[high] [float] NOT NULL,
	[volume] [float] NOT NULL,
	[closeAdjust] [float] NOT NULL,
 CONSTRAINT [PK_hist] PRIMARY KEY CLUSTERED 
(
	[code] ASC,
	[exchange] ASC,
	[date] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
